
clc
clear all
close all

load Anticipatedoptimal.mat
load Baseline.mat

T=50;


figure
subplot(1,2,1)
hold on
graphgt1=plot([1:150],((gc1_counterf(1:150)).*100.*1.0036))
set(graphgt1,'LineWidth',2, 'LineStyle', '-','color', 'b');
graphgt3=plot([1:150],((gc3_counterf(1:150)).*100.*1.0036))
set(graphgt3,'LineWidth',2, 'LineStyle', '--','color', 'r');
legend('USA', 'China')
title('Productivity growth')
ylabel('Percent')
hold off
subplot(1,2,2)
plot((exp(Y1(1:150)))./L1./(exp(Y3(1:150))./L3),'LineWidth',2, 'LineStyle', '-','color', 'b')
title('Relative Productivity US to China')

exportgraphics(gcf,'BGP_growth.pdf', 'Append', true);


figure 

subplot(2,2,1)
hold on
graphha1=plot([1:T],(Ha_Y1_counterf_anticipatedoptimal(1:T)).*100)
set(graphha1,'LineWidth',2, 'LineStyle', '--','color', 'k');
graphha1b=plot([1:T],(Ha_Y1_counterf(1:T)).*100)
set(graphha1b,'LineWidth',2, 'LineStyle', '-','color', 'b');

ylabel('Percent')
title('Adoption intensity US')
hold off
subplot(2,2,2)
hold on
graphha3=plot([1:T],(Ha_Y3_counterf_anticipatedoptimal(1:T)).*100)
set(graphha3,'LineWidth',2, 'LineStyle', '--','color', 'k');
graphha3b=plot([1:T],(Ha_Y3_counterf(1:T)).*100)
set(graphha3b,'LineWidth',2, 'LineStyle', '-','color', 'b');

title('Adoption intensity China')
ylabel('Percent')
hold off

subplot(2,2,3)
hold on
graphhr1=plot([1:T],(Hr_Y1_counterf_anticipatedoptimal(1:T)).*100)
set(graphhr1,'LineWidth',2, 'LineStyle', '--','color', 'k');
graphhr1b=plot([1:T],(Hr_Y1_counterf(1:T)).*100)
set(graphhr1b,'LineWidth',2, 'LineStyle', '-','color', 'b');

title('R&D intensity US')
ylabel('Percent')
hold off


subplot(2,2,4)
hold on
graphhr3=plot([1:T],(Hr_Y3_counterf_anticipatedoptimal(1:T)).*100)
set(graphhr3,'LineWidth',2, 'LineStyle', '--','color', 'k');
graphhr3b=plot([1:T],(Hr_Y3_counterf(1:T)).*100)
set(graphhr3b,'LineWidth',2, 'LineStyle', '-','color', 'b');
title('R&D intensity China')
ylabel('Percent')
legend('Anticipated', 'Baseline')
hold off
exportgraphics(gcf,'Innovationadoption.pdf', 'Append', true);



figure 

subplot(2,2,1)
hold on
graphrpp=plot([1:T],(RP1paid_counterf_anticipatedoptimal(1:T)).*100);
set(graphrpp,'LineWidth',2, 'LineStyle', '--','color', 'k');
graphrppb=plot([1:T],(RP1paid_counterf(1:T)).*100);
set(graphrppb,'LineWidth',2, 'LineStyle', '-','color', 'b');

title('Royalties paid by the US (% GDP)')
ylabel('Percent')
hold off

subplot(2,2,2)
hold on
graphrpr=plot([1:T],(RP1received_counterf_anticipatedoptimal(1:T)).*100);
set(graphrpr,'LineWidth',2, 'LineStyle', '--','color', 'k');
graphrprb=plot([1:T],(RP1received_counterf(1:T)).*100);
set(graphrprb,'LineWidth',2, 'LineStyle', '-','color', 'b');
title('Royalties paid by China (% GDP)')
ylabel('Percent')



subplot(2,2,3)
hold on
graphrpp=plot([1:T],(HTS_1_counterf_anticipatedoptimal(1:T)).*100);
set(graphrpp,'LineWidth',2, 'LineStyle', '--','color', 'k');
graphrppb=plot([1:T],(HTS_1_counterf(1:T)).*100);
set(graphrppb,'LineWidth',2, 'LineStyle', '-','color', 'b');

title('Home trade share US')
ylabel('Percent')
hold off

subplot(2,2,4)
hold on
graphrpp=plot([1:T],(HTS_3_counterf_anticipatedoptimal(1:T)).*100);
set(graphrpp,'LineWidth',2, 'LineStyle', '--','color', 'k');
graphrppb=plot([1:T],(HTS_3_counterf(1:T)).*100);
set(graphrppb,'LineWidth',2, 'LineStyle', '-','color', 'b');
title('Home trade share China')
ylabel('Percent')
legend('Anticipated', 'Baseline')

hold off

exportgraphics(gcf,'RoyaltiesHTS.pdf', 'Append', true);
